
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
?>

<form action="<?php echo JRoute::_('index.php?option=com_cproject&view=categories'); ?>" method="post" name="adminForm" id="adminForm">

    <div class="filter-search fltlft">
        <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
        <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_ARTICLEFLOW_SEARCH_IN_TITLE'); ?>" />
        <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
        <button type="button" onclick="document.id('filter_search').value='';this.form.getElementById('filter_published').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
    </div>
    <div class="filter-select fltrt">

        <select name="filter_section" class="inputbox" onchange="this.form.submit()">
            <option value=""><?php echo JText::_('- Select section -'); ?></option>
            <?php echo JHtml::_('select.options', CprojectDBHelper::getCprojectSection($sql = false, array('a.published = 1')), 'id', 'name', $this->state->get('filter.section')); ?>
        </select>
        <select id="filter_published" name="filter_published" class="inputbox" onchange="this.form.submit()">
            <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></option>
            <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true); ?>
        </select>


    </div>
    <div class="clr"> </div>

    <table class="adminlist">
        <thead>
            <tr>
                <th width="5%"> <input type="checkbox" name="toggle" value="" onclick="checkAll(this)" /></th>
                <th>Name</th>
                <th width="5%">Published</th>
                <th width="20%" nowrap="nowrap">
                    <?php echo JText::_('Section'); ?>
                </th>
                <th width="10%" nowrap="nowrap">
                    <?php echo JText::_('Created by'); ?>
                </th>
                <th width="8%" nowrap="nowrap">
                    <?php echo JText::_('Created on'); ?>
                </th>
                <th width="10%" nowrap="nowrap">
                    <?php echo JText::_('Modified by'); ?>
                </th>
                <th width="8%" nowrap="nowrap">
                    <?php echo JText::_('Modified on'); ?>
                </th>
                <th width="5%">ID</th>

            </tr>
        <tfoot>
            <tr>
                <td colspan="9"> <?php echo $this->pagination->getListFooter(); ?></td>
            </tr>
        </tfoot>
        <tbody>
            <?php
            foreach ($this->items as $i => $item) {
                $link = JRoute::_('index.php?option=com_cproject&task=category.edit&id= ' . (int) $item->id);
                $canChange = 1;
                ?>
                <tr class="row<?php echo $i % 2; ?>">
                    <td class="center">
                        <?php echo JHtml::_('grid.id', $i, $item->id); ?>
                    </td>
                    <td><a href="<?php echo $link; ?>"><?php echo $this->escape($item->name); ?></a></td>
                    <td class="center"><?php echo JHtml::_('jgrid.published', $item->published, $i, 'categories.', $canChange); ?></td>
                    <td class="center" ><?php echo $item->secname; ?></td>
                    <td class="center"><?php echo $item->created_by; ?></td>
                    <td class="center"><?php echo date_format(date_create($item->created_on), 'd-m-Y h:i:s'); ?></td>
                    <td class="center"><?php echo $item->modified_by; ?></td>
                    <td class="center"><?php echo date_format(date_create($item->modified_on), 'd-m-Y h:i:s'); ?></td>
                    <td class="center"><?php echo $item->id; ?></td>
                </tr>
                <?php
            }
            ?>
        </tbody>


    </table>

    <div>
        <input type="hidden" name="task" value="" />
        <input type="hidden" name="boxchecked" value="0" />
        <?php echo JHtml::_('form.token'); ?>
    </div>
</form> 

